package tg.app.rj.tslx;

import java.rmi.RemoteException;
import java.util.Vector;
import psdi.mbo.Mbo;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSet;
import psdi.mbo.MboValueData;
import psdi.security.UserInfo;
import psdi.util.MXException;

public class TslxStatus extends Mbo
  implements TslxStatusRemote
{
  private static final long serialVersionUID = -4084743866618232298L;

  public TslxStatus(MboSet mboset)
    throws MXException, RemoteException
  {
    super(mboset);
  }

  public void init() throws MXException {
    setFlag(7L, true);
    super.init();
  }

  public void add() throws MXException, RemoteException {
    MboRemote mboremote = getOwner();
    if ((mboremote != null) && ("T_ZC_TSLX".equals(mboremote.getName())))
    {
      setValue("TSDLXNUM", mboremote.getString("TSDLXNUM"), 2L);
      setValue("STATUS", mboremote.getString("STATUS"), 2L);
      setValue("changedate", mboremote.getDate("statusdate"), 2L);
      setValue("CHANGEBY", mboremote.getUserInfo().getUserName(), 3L);
      setValue("siteid", mboremote.getString("siteid"), 2L);
      setValue("orgid", mboremote.getString("orgid"), 2L);
      return;
    }
  }

  public Vector getFuelVerifyStatusRecord() throws MXException, RemoteException
  {
    Vector v = new Vector();
    v.addElement(getMboValueData("changedate").getData());
    v.addElement(getMboValueData("memo").getData());
    v.addElement(getMboValueData("status").getData());
    v.addElement(getMboValueData("changeby").getData());
    v.addElement(getMboValueData("TSDLXNUM").getData());
    v.addElement("");
    return v;
  }
}